package com.mypackage.diary.model;

// Generated Nov 7, 2014 12:02:55 AM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Comment generated by hbm2java
 */
@Entity
@Table(name = "comment", catalog = "diary")
public class Comment implements java.io.Serializable {

	private Integer idComment;
	private Userprofile userprofile;
	private Diary diary;
	private String text;
	private boolean isApproved;
	private int parentId;
	private Date create;
	private Date modified;

	public Comment() {
	}

	public Comment(Userprofile userprofile, Diary diary, String text,
			boolean isApproved, int parentId) {
		this.userprofile = userprofile;
		this.diary = diary;
		this.text = text;
		this.isApproved = isApproved;
		this.parentId = parentId;
	}

	public Comment(Userprofile userprofile, Diary diary, String text,
			boolean isApproved, int parentId, Date create, Date modified) {
		this.userprofile = userprofile;
		this.diary = diary;
		this.text = text;
		this.isApproved = isApproved;
		this.parentId = parentId;
		this.create = create;
		this.modified = modified;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idComment", unique = true, nullable = false)
	public Integer getIdComment() {
		return this.idComment;
	}

	public void setIdComment(Integer idComment) {
		this.idComment = idComment;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "IdAuthor", nullable = false)
	public Userprofile getUserprofile() {
		return this.userprofile;
	}

	public void setUserprofile(Userprofile userprofile) {
		this.userprofile = userprofile;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "IdDairy", nullable = false)
	public Diary getDiary() {
		return this.diary;
	}

	public void setDiary(Diary diary) {
		this.diary = diary;
	}

	@Column(name = "Text", nullable = false)
	public String getText() {
		return this.text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Column(name = "IsApproved", nullable = false)
	public boolean isIsApproved() {
		return this.isApproved;
	}

	public void setIsApproved(boolean isApproved) {
		this.isApproved = isApproved;
	}

	@Column(name = "ParentId", nullable = false)
	public int getParentId() {
		return this.parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "Create", length = 19)
	public Date getCreate() {
		return this.create;
	}

	public void setCreate(Date create) {
		this.create = create;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "Modified", length = 19)
	public Date getModified() {
		return this.modified;
	}

	public void setModified(Date modified) {
		this.modified = modified;
	}

}
